import Vue from 'vue'
import { Message } from 'element-ui';
import App from './App.vue'
import router from './router'
import store from './store'
import { VueJsonp } from 'vue-jsonp'

Vue.use(VueJsonp)

Vue.config.productionTip = false

// Vue.use(Message);
// Vue.component(Message.name, Message)
Vue.prototype.$message = Message;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')


// 路由跳转之后始终回到顶部
router.beforeEach((to, from, next) => {  
   // chrome
   document.body.scrollTop = 0
   // firefox
   document.documentElement.scrollTop = 0
   // safari
   window.pageYOffset = 0
   next()
  })